package yijy.arrayExamples;

/**
 * Created by yijy on 2017/8/11.
 */
public class ArrayTest1 {
    public final static int length=4;
    public static void main(String[] args) {
        System.out.println(args.length);
       if(args.length!=0){
           System.out.println(args[args.length-1]);
       }
       try {
           System.out.println(args[args.length]);
           int ix1 = args.length-1;
           if(ix1>0){
               System.out.println(args[ix1]);
           }
           System.out.println(args[args.length-1]);
           //       int ix = args.length;
//       String last = args[ix];
//       if(ix!=0){
//           System.out.println(last);
//       }
       }catch (ArrayIndexOutOfBoundsException e){}
       catch (NullPointerException e){}
    }

    public void test1(int[] it){
        System.out.println(it.length);
    }
}
